package com.movie.act;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * 28-动态密码登 录 29-服务密码登 录
 * 
 * @author Administrator
 * 
 */
public class UserLoginAct extends Activity {
	private ImageView showleft = null;
	private ImageView showright = null;
	private TextView autopwd_num = null;
	private TextView serverpwd_num = null;
	private TextView autopwd_pass = null;
	private TextView serverpwd_pass = null;
	private TextView login = null;
	private TextView getautopwd = null;
	private LinearLayout autopwd_l = null;
	private LinearLayout serverpwd_l = null;
	private LinearLayout l_selected = null;
	private LinearLayout selected = null;
	private LinearLayout left_l = null;
	private LinearLayout right_l = null;
	public void release() {
		showleft = null;
		showright = null;
		autopwd_num = null;
		serverpwd_num = null;
		autopwd_pass = null;
		serverpwd_pass = null;
		login = null;
		getautopwd = null;
		if (autopwd_l != null) {
			autopwd_l.removeAllViews();
			autopwd_l = null;
		}
		if (serverpwd_l != null) {
			serverpwd_l.removeAllViews();
			serverpwd_l = null;
		}
	}
//
//	private int[] background = new int[] { R.drawable.passleft1,
//			R.drawable.passright1, R.drawable.passleft2, R.drawable.passright2 };

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.userloginact);
		// userloginact
		findViewByIds();
		autopwd_l.setVisibility(View.VISIBLE);
		l_selected = autopwd_l;
		selected = left_l;
		showleft.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				selected.setVisibility(View.INVISIBLE);
				l_selected.setVisibility(View.INVISIBLE);
//				autopwd.setBackgroundColor(background[0]);
//				serverpwd.setBackgroundColor(background[1]);
//				autopwd.invalidate();
//				serverpwd.invalidate();
				l_selected = autopwd_l;
				left_l.setVisibility(View.VISIBLE);
				selected=left_l;
//				selected = autopwd;
				autopwd_l.setVisibility(View.VISIBLE);
			}
		});

		showright.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				selected.setVisibility(View.INVISIBLE);
				l_selected.setVisibility(View.INVISIBLE);
				l_selected = serverpwd_l;
//				selected = serverpwd;
				right_l.setVisibility(View.VISIBLE);
				selected=right_l;
				serverpwd_l.setVisibility(View.VISIBLE);
			}
		});

		getautopwd.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

			}
		});

	}

	private void findViewByIds() {
		showleft = (ImageView) findViewById(R.id.autopwd);
		showright = (ImageView) findViewById(R.id.serverpwd);
		autopwd_num = (TextView) findViewById(R.id.autopwd_num);
		serverpwd_num = (TextView) findViewById(R.id.serverpwd_num);
		autopwd_pass = (TextView) findViewById(R.id.autopwd_pass);
		serverpwd_pass = (TextView) findViewById(R.id.serverpwd_pass);
		login = (TextView) findViewById(R.id.login);
		getautopwd = (TextView) findViewById(R.id.getautopwd);
		autopwd_l = (LinearLayout) findViewById(R.id.autopwd_l);
		serverpwd_l = (LinearLayout) findViewById(R.id.serverpwd_l);
		
		left_l = (LinearLayout) findViewById(R.id.left_l);
		right_l = (LinearLayout) findViewById(R.id.right_l);
	}

}
